#! /usr/bin/python

MAX = 1000
ss = 0

for n in range(1, MAX, 2):
    a = 2*n + 1
    if a > 1000: break
    for i in range(4):
	if a+i > 1000: break
        ss = ss + ((a-1+i)**n + (a+1+i)**n)%((a+i)**2)
ss = 0
for a in range(3, 1001):
    ss += 2*a*((a-1)/2) 
print ss
print (999**499 + 1001*499)%(1000**2), 2*499*1000, 499**2
